const Mock = require('mockjs')

const PerformanceList1=[];
const PerformanceList2=[];


for(let i=0;i<10;i++){
    PerformanceList1.push(
        Mock.mock({
            id:'@increment',
            departid:'@integer(1,20)',
            departname:'@first',
            guider:'@first',
            register:'@integer(0,30)',
            registertarget:'@integer(10,50)',
            keep:'@integer(0,30)',
            keeptarget:'@integer(10,50)',
            boutique:'@integer(0,30)',
            boutiquetarget:'@integer(10,50)',
            insurance:'@integer(0,30)',
            insurancetarget:'@integer(10,50)',
            order:'@integer(0,30)',
            ordertarget:'@integer(10,50)',
            loan:'@integer(0,30)',
            loantarget:'@integer(10,50)',
            month:'@datetime',
            createtime:'@datetime'
        })
    )
}

for(let i=0;i<10;i++){
    PerformanceList2.push(
        Mock.mock({
            id:'@increment',
            departid:'@integer(1,20)',
            departname:'@first',
            guider:'@first',
            car:'@integer(300000,99999999)',
            boutique:'@integer(10000,99999)',
            insurance:'@integer(20000,999999)',
            register:'@integer(1000,9999)',
            tax:'@integer(10000,99999)',
            other:'@integer(10000,99999)',
            month:'@datetime',
            createtime:'@datetime'
        })
    )
}

const PerformanceList_OtherFail=[];

for(let i=0;i<10;i++){
    PerformanceList_OtherFail.push(
        Mock.mock({
            id:'@increment',
            departid:'@integer(1,20)',
            departname:'@first',
            guider:'@first',
            fail:'@integer(0,99)',
            month:'@datetime',
            createtime:'@datetime'
        })
    )
}

const PerformanceList_OtherFailDetails=[];
for(let i=0;i<10;i++){
    PerformanceList_OtherFailDetails.push(
        Mock.mock({
            id:'@increment',
            departid:'@integer(1,20)',
            customername:'@first',
            customerphone:'@phone',
            guider:'@first',
            visited:'@integer(0,99)',
            intentioncar:'@integer(0,99)',
            intentionprice:'@integer(0,99)',
            shopprice:'@integer(0,99)',
            createtime:'@datetime'
        })
    )
}

//提车

const PerformanceList_OtherPickUP=[];

for(let i=0;i<10;i++){
    PerformanceList_OtherPickUP.push(
        Mock.mock({
            id:'@increment',
            departid:'@integer(1,20)',
            departname:'@first',
            guider:'@first',
            order:'@integer(0,99)',
            pickup:'@integer(0,99)',
            month:'@datetime',
            createtime:'@datetime'
        })
    )
}

const PerformanceList_OtherPickupDetails=[];
for(let i=0;i<10;i++){
    PerformanceList_OtherPickupDetails.push(
        Mock.mock({
            id:'@increment',
            departid:'@integer(1,20)',
            customername:'@first',
            customerphone:'@phone',
            guider:'@first',
            car:'@integer(0,99)',
            paytype:'@integer(0,99)',
            price:'@integer(0,999)',
            shopprice:'@integer(0,99)',
            createtime:'@datetime'
        })
    )
}

//车辆毛利明细
const PerformanceCarprofitList=[];
for(let i=0;i<10;i++){
    PerformanceCarprofitList.push(
        Mock.mock({
            id:'@increment',
            car:'@first',
            vincode:'@integer(1000000,9999999)',
            guider:'@first',
            departname:'@first',
            customername:'@first',
            customerphone:'@integer(13011221111,1899999999)',
            carcost:'@integer(10,300)',
            carprice:'@integer(10,400)',
            carsaleprice:'@integer(10,400)',
            boutiquecost:'@integer(10,400)',
            boutiqueprice:'@integer(10,400)',
            insurancecost:'@integer(10,400)',
            insuranceprice:'@integer(10,400)',
            insurancerebate:'@integer(10,100)',
            registercost:'@integer(10,100)',
            registerprice:'@integer(10,100)',
            othercost:'@integer(10,100)',
            otherprice:'@integer(10,100)',
            totalprofit:'@integer(100,500)',
            debate1:'@integer(100,500)',
            debate2:'@integer(100,500)',
            debate3:'@integer(100,500)',
            createtime:'@datetime'
        })
    )
}


module.exports=[
    {
        url: '/api/analyze/performancequota',
        type: 'get',
        response: config => {
          
          var mockList=PerformanceList1.filter(o=>true);
          return {
            code: '10000',
            data: {
              total: mockList.length,
              items: mockList
            }
          }
        }
      },
      {
        url: '/api/analyze/performancemoney',
        type: 'get',
        response: config => {
          
          var mockList=PerformanceList2.filter(o=>true);
          return {
            code: '10000',
            data: {
              total: mockList.length,
              items: mockList
            }
          }
        }
      },
      {
        url: '/api/analyze/performanceother_fail',
        type: 'get',
        response: config => {
          
          var mockList=PerformanceList_OtherFail.filter(o=>true);
          return {
            code: '10000',
            data: {
              total: mockList.length,
              items: mockList
            }
          }
        }
      },
      {
        url: '/api/analyze/performanceother_detailsfail',
        type: 'get',
        response: config => {
          
          var mockList=PerformanceList_OtherFailDetails.filter(o=>true);
          return {
            code: '10000',
            data: {
              total: mockList.length,
              items: mockList
            }
          }
        }
      },

      {
        url: '/api/analyze/performanceother_pickup',
        type: 'get',
        response: config => {
          
          var mockList=PerformanceList_OtherPickUP.filter(o=>true);
          return {
            code: '10000',
            data: {
              total: mockList.length,
              items: mockList
            }
          }
        }
      },

      {
        url: '/api/analyze/performanceother_detailspickup',
        type: 'get',
        response: config => {
          
          var mockList=PerformanceList_OtherPickupDetails.filter(o=>true);
          return {
            code: '10000',
            data: {
              total: mockList.length,
              items: mockList
            }
          }
        }
      },

      {
        url: '/api/analyze/carprofit',
        type: 'get',
        response: config => {
          
          var mockList=PerformanceCarprofitList.filter(o=>true);
          return {
            code: '10000',
            data: {
              total: mockList.length,
              items: mockList
            }
          }
        }
      },
]
